#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
const int mod=998244353;
int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

	int t;
	cin >> t;
	while(t--)
	{
		int x1,y1,x2,y2,x3,y3;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		long double a=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
		long double b=(x1-x3)*(x1-x3)+(y1-y3)*(y1-y3);
		long double c=(x3-x2)*(x3-x2)+(y3-y2)*(y3-y2);
		if(a+b==c||a+c==b||b+c==a)
		{
			cout << "yes" << endl;
		}
		else
		{
			cout << "no" << endl;
		}
	}
    return 0;
}

